home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
- # This is the make pre-processor program written in the 'C' shell.
- #
- # mkp defines a group of parameters and passes them to make.
- # SWITCHES:
- # -f <filename>
- # source <filename. priore to invoking make.
- # If -f is not present and .mkprc exists in the current directory
- # it is sourced. Otherwise if .mkprc exists in the home directory
- # it is sourced.
- # --
- # argument parsing is terminated remainder of command line is passed
- # to make as is.
- #
- set MKPFILE=.mkprc
- set mkpname=$0
- set mkpname=$mkpname:t
- # ### VISIBLE MAKE TOOLS
- set MAKE=make
- set CC=cc
- set AS="as -"
- set LK=""
- set LD=""
- set LINT="lint -u"
- set REMOVE="rm -f"
- set CTAGS="ctags -w"
- # Internal parametrs
- set INCFLAGS = -I.
- # ### VISIBLE MAKE PARAMETERS
- #set CFLAGS = "${INCFLAGS} -DBSD4_2 -Uunix -DMSDOS"
- set CFLAGS = "${INCFLAGS} -DBSD4_2 "
- set LINTFLAGS = ${INCFLAGS}
- set TARGETS
- # MKP FLAGS
- set S_MKPFILE
- #
- umask 002
- #
- #
- # Gather command line options
- #
- foreach i ($*)
- switch ($1)
- case -f:
- shift argv
- set S_MKPFILE=$1
- breaksw
- case --:
- shift argv
- break
- default:
- break
- breaksw
- endsw
- shift argv
- end
- #
- #
- #
- #
- if ("$S_MKPFILE" != "") then
- set MKPFILE = "$S_MKPFILE"
- source $MKPFILE
- else if (-f $MKPFILE) then
- source $MKPFILE
- else if (-f $HOME/$MKPFILE) then
- source $HOME/$MKPFILE
- endif
- #
- set TARGETS="$*"
- #
- $MAKE "CC=$CC" "AS=$AS" \
- "CFLAGS=$CFLAGS" "LINTFLAGS=$LINTFLAGS" \
- "LINT=$LINT" \
- "REMOVE=$REMOVE" "CTAGS=$CTAGS" \
- $TARGETS
- set ret=$status
- if ("$ret" != "0") then
- exit 1
- endif
- exit 0
-